package com.proxy;

import java.lang.reflect.Proxy;

/**
 * @User xiangyl
 * @Data 2020/10/2
 */
public class MyTest {

    public static void main(String[] args) {
        MyInterfaceImpl myInstance = new MyInterfaceImpl();
        MyInterface proxyInstance = (MyInterface) Proxy.newProxyInstance(myInstance.getClass().getClassLoader(),
                myInstance.getClass().getInterfaces(),
                new JdkProxy(myInstance));
        proxyInstance.proxyTest();
    }
}
